﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace AzureDriveCore
{
	public abstract class RequestContextBase : IDisposable
	{
		public RequestContextBase(AzureControllerBase controller)
		{
			this.Controller = controller;
		}

		protected AzureControllerBase Controller { get; private set; }

		public abstract bool CreateFile();

		public abstract bool DeleteDirectory();

		public abstract bool DeleteFile();

		public abstract void Dispose();

		public abstract bool InitializeAsFile();

		public DateTime CreatedDate { get; set; }

		public FileAttributes FileAttributes
		{
			get
			{
				return (this.FileExists) ? FileAttributes.Normal : FileAttributes.Directory;
			}
		}

		public bool FileExists { get; set; }

		public long FileSize { get; set; }

		public abstract uint ReadData(byte[] buffer, long offset);

		public abstract uint WriteData(byte[] buffer, long offset);
	}
}
